package com.hyt.it.ogt.kq.service.gov.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Future;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 考试任务表
 * </p>
 *
 * @author huangyh
 * @since 2021-03-08
 */
@Data
@Accessors(chain = true)
public class OnlineTaskBaseVO implements Serializable {
    private static final long serialVersionUID = 1L;

    private String id;

    @NotBlank(message = "考试任务名称不能为空")
    @Length(max = 20, message = "考试名称长度最多支持20个字")
    @ApiModelProperty(value = "考试任务名称(前端必传)")
    private String name;

    @Future(message = "考试开始时间必须大于当前时间")
    @NotNull(message = "考试开始时间不能为空")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "考试开始时间(前端必传)")
    private LocalDateTime beginDate;

    @Future(message = "考试结束时间必须大于当前时间")
    @NotNull(message = "考试结束时间不能为空")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "考试结束时间(前端必传)")
    private LocalDateTime endDate;

    @ApiModelProperty(value = "考试形式，1：线上机考，2：线下机考")
    private String examType;

    @ApiModelProperty(value = "考试分类")
    private String testClassify;

    @ApiModelProperty(value = "考试任务是否发布(true:是, false:否)", hidden = true)
    private Boolean publish;
}
